<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<script src="/yui/3.4.1/build/yui/yui-min.js" charset="utf-8"></script>
</head>
<body>

 			<div class="sidebar" style="border:1px #D3C8C8 solid">
				<h2>管理登陆</h2>
				<div class="validateTips" style="display:none;border:2px solid red;background-color:yellow;color:blue;font-weight:bolder;font-size:16px;overflow:hidden;margin-right:10px;"></div>
				<div class="sidebar_con">
				<div id="afterLogin" style="display:none;">
					<p>欢迎您：<span id="loginName"></span></p>
					<p><a href="/FirstGwt.html">管理</a></p>
				</div>
                  <FORM id="loginForm" name="loginForm" action="http://www.m3958.com/notrpclogin" method="post">
					<input type="hidden" name="want" value="redirect"/>
					<TABLE cellSpacing=0 cellPadding=0 width="100%" align=center border=0>
						<TBODY>
							<TR>
								<TD vAlign="center" align="middle" height="35">账号： <input class="input01" name="username" type="text" id="username"/></TD>
							</TR>
							<TR>
                              <TD align=middle height=35>密码： <input class="input01" type="password" name="password" id="password"/></TD>
							</TR>
							<TR>
								<TD vAlign=center align=middle height=30><input  type="image" src="/images/login.gif" /> &nbsp;&nbsp;<img src="/images/reset.gif" id="resetBt" style="cursor:pointer;"/>
								</TD>
							</TR>
							<TR>
								<TD vAlign=center align=middle height=30>
								</TD>
							</TR>
						</TBODY>
					</TABLE>
					</FORM>
				</div>
			</div>

<script type="text/javascript">
YUI().use("node","event","selector-css3","node-event-simulate",function(Y){
		Y.on('focus',function(e){
			window.location = "/in";
		},['#username','#password']);

});
</script>
 

<!-- 
			<div class="sidebar" style="border:1px #D3C8C8 solid">
				<h2>管理登陆</h2>
				<div class="validateTips" style="display:none;border:2px solid red;background-color:yellow;color:blue;font-weight:bolder;font-size:16px;overflow:hidden;margin-right:10px;"></div>
				<div class="sidebar_con">
				<div id="afterLogin" style="display:none;">
					<p>欢迎您：<span id="loginName"></span></p>

					<p><a href="/FirstGwt.html">管理</a></p>
				</div>
					<FORM id="loginForm" name="loginForm" action="" method=post>
					<input type="hidden" name="want" value="json"/>
					<TABLE cellSpacing=0 cellPadding=0 width="100%" align=center border=0>
						<TBODY>
							<TR>
								<TD vAlign=center align=middle height=35>账号： <input class="input01" name="username" type="text"/></TD>

							</TR>
							<TR>
								<TD align=middle height=35>密码： <input class="input01" type="password" name="password"/></TD>
							</TR>
							<TR>
								<TD vAlign=center align=middle height=30><input  type="image" src="/images/login.gif" /> &nbsp;&nbsp;<img src="/images/reset.gif" id="resetBt" style="cursor:pointer;"/>
								</TD>
							</TR>

							<TR>
								<TD vAlign=center align=middle height=30>
								<div id="captchaContainer" style="display:none;">验证码：<input  type="text" name="answer" /> &nbsp;&nbsp;<img src="/simpleImg" style="cursor:pointer;" id="captchaImg" title="如果看不清，请点我"></div>
								</TD>
							</TR>
						</TBODY>
					</TABLE>
					</FORM>

				</div>
			</div>
<script type="text/javascript">
YUI().use("io-form","selector-css3","json", "node","node-event-simulate","anim",function(Y){
		var fields = {
			username:Y.one('input[name=username]'),
			password:Y.one('input[name=password]'),
			answer:Y.one('input[name=answer]')
		};
		
		var loginForm = Y.one('#loginForm');
		
		Y.on('click',function(e){
			loginForm.reset();
			Y.one('#captchaContainer').hide();
			Y.each(fields,function(value,key,obj){
				if(value)value.setStyle('backgroundColor','').setStyle('color','');
			});
		},'#resetBt');
		
		Y.on('focus',function(e){
			Y.one('#captchaContainer').show();
		},[fields.username,fields.password]);
	
		var tips = Y.one( ".validateTips" );
		
		function updateTips( t ) {
			tips.setContent(t)
			tips.setStyle('height','100%');
			tips.show();
			setTimeout(function() {
				anim.run();
			}, 1500 );
		}
		
		var anim = new Y.Anim({
			node: tips,
			from:{height:'40px'},
			to: { height: 0 },
			easing: Y.Easing.backIn
		});
		
		anim.on('end',function(){
			var node = this.get('node');
			node.hide();
		});

		function checkExist(o,n){
			if(!o.get('value')){
				o.setStyle('backgroundColor','red').setStyle('color','white');
				o.simulate('focus');
				updateTips( n +"必须填写！");
				return false;
			}else{
				return true;
			}
		}
 
		function checkLength( o, n, min, max ) {
			if ( o.get('value').length > max || o.get('value').length < min ) {
				o.setStyle('backgroundColor','red').setStyle('color','white');
				o.simulate('focus');
				updateTips( n + " 的长度 " + "必须在" +
					min + " 和 " + max + "之间" );
				return false;
			} else {
				return true;
			}
		}
 
		function checkRegexp( o, regexp, n ) {
			if ( !( regexp.test( o.get('value') ) ) ) {
				o.setStyle('backgroundColor','red').setStyle('color','white');
				o.simulate('focus');
				updateTips( n );
				return false;
			} else {
				return true;
			}
		}
 
	Y.one('#captchaImg').on('click',function(e){
			this.set('src',"/simpleImg?" + Math.random());
	});
	
	var tH = {
			success: function(id, o, args) {
	    		var res = Y.JSON.parse(o.responseText).response;
	    		if(res.status == 0){
	    			window.location = "http://www.m3958.com/in";
//					Y.one('#afterLogin').show();
//					Y.one('#loginName').setContent(res.data[0].loginName);
//					loginForm.hide();
	    		}else{
					if(Y.Lang.isArray(res.data)){
						if(res.data[0].code == -11){
							updateTips("验证码错误");
							fields.answer.set('value','');
						}else if(res.data[0].code = -303){
							updateTips("用户名或密码错误！");
							fields.password.set('value','');
						}else{
							updateTips("发生未知错误");
						}
					}
	    		}
			 },
			failure: function(id, o, args) {
					   updateTips(o.statusText);
					 },
 
			end: function(id, args) {
				
			}
		};
		
		
	var cfg = {
		method: 'GET',
		form: {
			id: "loginForm",
			useDisabled: true
		},
		on: {
    			success: tH.success,
    			failure: tH.failure,
    			end: tH.end
    		},
    	context: tH
	};
 
	// Start the transaction.
	
	Y.on('submit',function(e){
		e.preventDefault();
				var bValid = true;
				Y.each(fields,function(value,key,obj){
					if(value)value.setStyle('backgroundColor','').setStyle('color','');
				});
					bValid = bValid && checkExist( fields.username, "用户名");
					bValid = bValid && checkExist( fields.password, "密码");
					bValid = bValid && checkExist( fields.answer, "验证码");
					if(bValid){
						var request = Y.io('/notrpclogin', cfg);
					}
		return false;
	},loginForm);
});
</script>
 -->
</body>
</html>